<?php
namespace Entities\Corp;
use Doctrine\ORM\Query;
use Doctrine\ORM\EntityRepository;

class EnderecoRepository extends EntityRepository
{
	public function listarUf($params = array())
	{
		$dql	= "SELECT e FROM Entities\Cep\Estado e";
		$query	= $this->getEntityManager()->createQuery($dql);

		return $query->getResult(Query::HYDRATE_OBJECT);
	}
	
	public function listComboUf()
	{
		$return	= array();
		foreach ($this->listarUf() as $value)
		{
			$return[$value->get('uf')]	= $value->get('estado');
		}
		return $return;
	}
}